<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibTools: H:/project/LibTools/src/algorithm/SafeMap.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibTools
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.16 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','搜索');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_fbc178c12bd249518b3c0868875b8083.html">algorithm</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">SafeMap.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_safe_map_8h.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef __SAFEMAP_H__</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define __SAFEMAP_H__</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160; </div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;../thread/Mutex.h&quot;</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;utility&gt;</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160; </div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<a class="code" href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">template</span>&lt;<span class="keyword">class</span> Kt, <span class="keyword">class</span> Vt, <span class="keyword">class</span> Ft = std::less&lt;Kt&gt; &gt;</div>
<div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="class_c_safe_map.html">   14</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_c_safe_map.html">CSafeMap</a></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;{</div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00018"></a><span class="lineno"><a class="line" href="class_c_safe_map.html#a8488f9453a01639d4c7b53e3757875d6">   18</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_safe_map.html#a8488f9453a01639d4c7b53e3757875d6">Insert</a>(<span class="keyword">const</span> Kt&amp; key, <span class="keyword">const</span> Vt&amp; value)</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    {</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;        <a class="code" href="class_c_lock_gurad.html">CLockGurad</a> lock(&amp;<a class="code" href="class_c_safe_map.html#af3726194bf1a06bc2561449e8fb8a1a8">_mutexMap</a>);</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;        <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.insert(std::make_pair(key, value));</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    }</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160; </div>
<div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="class_c_safe_map.html#a786c75f6b3b364940bd43e96ecda0d41">   29</a></span>&#160;    <span class="keywordtype">size_t</span> <a class="code" href="class_c_safe_map.html#a786c75f6b3b364940bd43e96ecda0d41">Erase</a>(<span class="keyword">const</span> Kt&amp; key)</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    {</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;        <a class="code" href="class_c_lock_gurad.html">CLockGurad</a> lock(&amp;<a class="code" href="class_c_safe_map.html#af3726194bf1a06bc2561449e8fb8a1a8">_mutexMap</a>);</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.erase(key);</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    }</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="class_c_safe_map.html#af58b78ecc0c618a603e8e023759b4ef8">   36</a></span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_c_safe_map.html#af58b78ecc0c618a603e8e023759b4ef8">Clear</a>()</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    {</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;        <a class="code" href="class_c_lock_gurad.html">CLockGurad</a> lock(&amp;<a class="code" href="class_c_safe_map.html#af3726194bf1a06bc2561449e8fb8a1a8">_mutexMap</a>);</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;        <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.clear();</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    }</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="class_c_safe_map.html#aac4e0d268555f9137e2c9d1e939f6a95">   47</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_c_safe_map.html#aac4e0d268555f9137e2c9d1e939f6a95">Pop</a>(Vt&amp; value)</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;    {</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;        <a class="code" href="class_c_lock_gurad.html">CLockGurad</a> lock(&amp;<a class="code" href="class_c_safe_map.html#af3726194bf1a06bc2561449e8fb8a1a8">_mutexMap</a>);</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.size() &gt; 0)</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;        {</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;            value = <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.begin()-&gt;second;</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;            <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.erase(<a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.begin());</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        }</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    }</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160; </div>
<div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="class_c_safe_map.html#aec02ee60533b0dcbfd2fae4e7de016b7">   65</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_c_safe_map.html#aec02ee60533b0dcbfd2fae4e7de016b7">Erase</a>(<span class="keyword">const</span> Kt&amp; key, Vt&amp; value)</div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    {</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        <a class="code" href="class_c_lock_gurad.html">CLockGurad</a> lock(&amp;<a class="code" href="class_c_safe_map.html#af3726194bf1a06bc2561449e8fb8a1a8">_mutexMap</a>);</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;        <span class="keyword">typename</span> std::map&lt;Kt, Vt, Ft&gt;::iterator it = <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.find(key);</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        <span class="keywordflow">if</span> (it != <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.end())</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        {</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;            value = it-&gt;second;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;            <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.erase(key);</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        }</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    }</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160; </div>
<div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="class_c_safe_map.html#ab92562ab690d28ba0a70516974381853">   80</a></span>&#160;    std::size_t <a class="code" href="class_c_safe_map.html#ab92562ab690d28ba0a70516974381853">Size</a>()</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    {</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <a class="code" href="class_c_lock_gurad.html">CLockGurad</a> lock(&amp;<a class="code" href="class_c_safe_map.html#af3726194bf1a06bc2561449e8fb8a1a8">_mutexMap</a>);</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.size();</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    }</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160; </div>
<div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="class_c_safe_map.html#a3a6a6bf2b2833c8fa83f3dc69992937c">   87</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_c_safe_map.html#a3a6a6bf2b2833c8fa83f3dc69992937c">Find</a>(<span class="keyword">const</span> Kt&amp; key)</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    {</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <a class="code" href="class_c_lock_gurad.html">CLockGurad</a> lock(&amp;<a class="code" href="class_c_safe_map.html#af3726194bf1a06bc2561449e8fb8a1a8">_mutexMap</a>);</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.find(key) != <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.end())</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        {</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;        }</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160; </div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    }</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160; </div>
<div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="class_c_safe_map.html#a7472a5bab1f2d33c67d1ae431b6cbf68">  104</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_c_safe_map.html#a7472a5bab1f2d33c67d1ae431b6cbf68">Find</a>(<span class="keyword">const</span> Kt&amp; key, Vt&amp; value)</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    {</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <a class="code" href="class_c_lock_gurad.html">CLockGurad</a> lock(&amp;<a class="code" href="class_c_safe_map.html#af3726194bf1a06bc2561449e8fb8a1a8">_mutexMap</a>);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <span class="keyword">typename</span> std::map&lt;Kt, Vt, Ft&gt;::iterator it = <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.find(key);</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        <span class="keywordflow">if</span> (it != <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>.end())</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        {</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;            value = it-&gt;second;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;            <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        }</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    }</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">  117</a></span>&#160;    std::map&lt;Kt, Vt, Ft&gt; <a class="code" href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">_mapData</a>;</div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="class_c_safe_map.html#af3726194bf1a06bc2561449e8fb8a1a8">  118</a></span>&#160;    <a class="code" href="class_c_mutex.html">CMutex</a> <a class="code" href="class_c_safe_map.html#af3726194bf1a06bc2561449e8fb8a1a8">_mutexMap</a>;</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;};</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160; </div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<a class="code" href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160; </div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_c_safe_map_html_af3726194bf1a06bc2561449e8fb8a1a8"><div class="ttname"><a href="class_c_safe_map.html#af3726194bf1a06bc2561449e8fb8a1a8">CSafeMap::_mutexMap</a></div><div class="ttdeci">CMutex _mutexMap</div><div class="ttdef"><b>Definition:</b> <a href="_safe_map_8h_source.html#l00118">SafeMap.h:118</a></div></div>
<div class="ttc" id="aclass_c_safe_map_html"><div class="ttname"><a href="class_c_safe_map.html">CSafeMap</a></div><div class="ttdoc">线程安全的映射类</div><div class="ttdef"><b>Definition:</b> <a href="_safe_map_8h_source.html#l00014">SafeMap.h:14</a></div></div>
<div class="ttc" id="aclass_c_mutex_html"><div class="ttname"><a href="class_c_mutex.html">CMutex</a></div><div class="ttdoc">常规锁</div><div class="ttdef"><b>Definition:</b> <a href="_mutex_8h_source.html#l00025">Mutex.h:25</a></div></div>
<div class="ttc" id="atools_8h_html_a201ce692c9dca6599e5c12d00167419b"><div class="ttname"><a href="tools_8h.html#a201ce692c9dca6599e5c12d00167419b">DEF_BEG_LIBTOOLS</a></div><div class="ttdeci">#define DEF_BEG_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00036">tools.h:36</a></div></div>
<div class="ttc" id="aclass_c_safe_map_html_a7472a5bab1f2d33c67d1ae431b6cbf68"><div class="ttname"><a href="class_c_safe_map.html#a7472a5bab1f2d33c67d1ae431b6cbf68">CSafeMap::Find</a></div><div class="ttdeci">bool Find(const Kt &amp;key, Vt &amp;value)</div><div class="ttdoc">查找相应的key是否存在，并返回value值</div><div class="ttdef"><b>Definition:</b> <a href="_safe_map_8h_source.html#l00104">SafeMap.h:104</a></div></div>
<div class="ttc" id="aclass_c_lock_gurad_html"><div class="ttname"><a href="class_c_lock_gurad.html">CLockGurad</a></div><div class="ttdoc">常规锁包装器</div><div class="ttdef"><b>Definition:</b> <a href="_mutex_8h_source.html#l00041">Mutex.h:41</a></div></div>
<div class="ttc" id="aclass_c_safe_map_html_a3a6a6bf2b2833c8fa83f3dc69992937c"><div class="ttname"><a href="class_c_safe_map.html#a3a6a6bf2b2833c8fa83f3dc69992937c">CSafeMap::Find</a></div><div class="ttdeci">bool Find(const Kt &amp;key)</div><div class="ttdoc">查找键值是否存在</div><div class="ttdef"><b>Definition:</b> <a href="_safe_map_8h_source.html#l00087">SafeMap.h:87</a></div></div>
<div class="ttc" id="aclass_c_safe_map_html_ae54b350edc4756a08e2428cacd4d075c"><div class="ttname"><a href="class_c_safe_map.html#ae54b350edc4756a08e2428cacd4d075c">CSafeMap::_mapData</a></div><div class="ttdeci">std::map&lt; Kt, Vt, Ft &gt; _mapData</div><div class="ttdef"><b>Definition:</b> <a href="_safe_map_8h_source.html#l00117">SafeMap.h:117</a></div></div>
<div class="ttc" id="aclass_c_safe_map_html_a8488f9453a01639d4c7b53e3757875d6"><div class="ttname"><a href="class_c_safe_map.html#a8488f9453a01639d4c7b53e3757875d6">CSafeMap::Insert</a></div><div class="ttdeci">void Insert(const Kt &amp;key, const Vt &amp;value)</div><div class="ttdoc">插入一个元素</div><div class="ttdef"><b>Definition:</b> <a href="_safe_map_8h_source.html#l00018">SafeMap.h:18</a></div></div>
<div class="ttc" id="atools_8h_html_ac909db71799bb22cb7d636a34cd785e4"><div class="ttname"><a href="tools_8h.html#ac909db71799bb22cb7d636a34cd785e4">DEF_END_LIBTOOLS</a></div><div class="ttdeci">#define DEF_END_LIBTOOLS</div><div class="ttdef"><b>Definition:</b> <a href="tools_8h_source.html#l00038">tools.h:38</a></div></div>
<div class="ttc" id="aclass_c_safe_map_html_af58b78ecc0c618a603e8e023759b4ef8"><div class="ttname"><a href="class_c_safe_map.html#af58b78ecc0c618a603e8e023759b4ef8">CSafeMap::Clear</a></div><div class="ttdeci">void Clear()</div><div class="ttdoc">清空所有元素</div><div class="ttdef"><b>Definition:</b> <a href="_safe_map_8h_source.html#l00036">SafeMap.h:36</a></div></div>
<div class="ttc" id="aclass_c_safe_map_html_aac4e0d268555f9137e2c9d1e939f6a95"><div class="ttname"><a href="class_c_safe_map.html#aac4e0d268555f9137e2c9d1e939f6a95">CSafeMap::Pop</a></div><div class="ttdeci">bool Pop(Vt &amp;value)</div><div class="ttdoc">删除第一个元素元素</div><div class="ttdef"><b>Definition:</b> <a href="_safe_map_8h_source.html#l00047">SafeMap.h:47</a></div></div>
<div class="ttc" id="aclass_c_safe_map_html_aec02ee60533b0dcbfd2fae4e7de016b7"><div class="ttname"><a href="class_c_safe_map.html#aec02ee60533b0dcbfd2fae4e7de016b7">CSafeMap::Erase</a></div><div class="ttdeci">bool Erase(const Kt &amp;key, Vt &amp;value)</div><div class="ttdoc">查找并返回结果值，之后在清除该元素</div><div class="ttdef"><b>Definition:</b> <a href="_safe_map_8h_source.html#l00065">SafeMap.h:65</a></div></div>
<div class="ttc" id="aclass_c_safe_map_html_ab92562ab690d28ba0a70516974381853"><div class="ttname"><a href="class_c_safe_map.html#ab92562ab690d28ba0a70516974381853">CSafeMap::Size</a></div><div class="ttdeci">std::size_t Size()</div><div class="ttdoc">返回当前大小</div><div class="ttdef"><b>Definition:</b> <a href="_safe_map_8h_source.html#l00080">SafeMap.h:80</a></div></div>
<div class="ttc" id="aclass_c_safe_map_html_a786c75f6b3b364940bd43e96ecda0d41"><div class="ttname"><a href="class_c_safe_map.html#a786c75f6b3b364940bd43e96ecda0d41">CSafeMap::Erase</a></div><div class="ttdeci">size_t Erase(const Kt &amp;key)</div><div class="ttdoc">删除元素</div><div class="ttdef"><b>Definition:</b> <a href="_safe_map_8h_source.html#l00029">SafeMap.h:29</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
